Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-19.1: util/log: ensure that secondary loggers do not l… #41233

Merged
merged 1 commit into from
Oct 1, 2019

Conversation

knz
Copy link
Contributor

@knz knz commented Oct 1, 2019

Backport 1/1 commits from #41231.

/cc @cockroachdb/release


Fixes #41230.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@petermattis petermattis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @nvanbenschoten and @petermattis)

Prior to this patch, logging via a secondary logger would allocate a
buffer, then add it to the buffer free list of the secondary logger.

This was causing a memory leak because only the free list from the
main logger is used to allocate buffers (even in secondary loggers),
so all the now-unused buffers from secondary logs would remain unused
and accumulate, locked from Go's GC attention because they are
referenced somewhere.

Release justification: bug fix

Release note (bug fix): A memory leak was fixed that affected
secondary logging (SQL audit logs, statement execution, and RocksDB
logging).
@knz
Copy link
Contributor Author

knz commented Oct 1, 2019

TFYR!

@knz knz changed the title release-19.1: util/log: ensure that secondary loggers do not leak memory release-19.1: util/log: ensure that secondary loggers do not l… Oct 1, 2019
@knz knz merged commit 4ae9892 into cockroachdb:release-19.1 Oct 1, 2019
@knz knz deleted the backport19.1-41231 branch October 1, 2019 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants